<template>
  <div style="background-color: #42b983; height:720px;">
    <el-container style="height: 100%;">
      <el-header style="background-color: #42b983">
        <h1 style="margin-top: 14px;margin-left: 10px;">
          软件缺陷分析与预测系统
        </h1>
      </el-header>

      <el-row :gutter="20" style="margin-right: 0;margin-left: 10px">
        <el-col :span="6">
          <div class="grid-content bg-purple"
               style="height: 550px;background-color: rgb(164, 229, 191);border-radius: 10px">
            <div style="padding-top: 10px; text-align: center; font-weight: bold;">
              导航
            </div>
            <el-menu
                router
                :default-active="this.$route.path"
                :default-openeds="['1', '3']"
                style="background-color: #a4e5bf;text-align: center;border-radius: 10px;padding-top: 10px;border-width: 0;">
              <el-menu-item index="/Home">
                <i class="el-icon-s-home"></i>
                <span slot="title">主页</span>
              </el-menu-item>
              <hr style="height:1px;border:none;border-top:1px solid #555555">
              <el-menu-item index="/Predict">
                <i class="el-icon-s-tools"></i>
                <span slot="title">分析预测</span>
              </el-menu-item>
              <hr style="height:1px;border:none;border-top:1px solid #555555">
              <el-menu-item index="/History">
                <i class="el-icon-s-data"></i>
                <span slot="title">历史数据</span>
              </el-menu-item>
              <hr style="height:1px;border:none;border-top:1px solid #555555">
            </el-menu>
          </div>
        </el-col>

        <el-col :span="17">
          <div class="grid-content bg-purple" style="background-color: #a4e5bf; height: 550px;border-radius: 10px">
            <p style="font-weight:bold;padding-top: 40px;padding-left: 50px;margin-bottom: -20px;margin-top: 0px; ">
              导入数据集:
            </p>
            <el-upload
                class="upload-demo"
                action="https://jsonplaceholder.typicode.com/posts/"
                :on-preview="handlePreview"
                :on-remove="handleRemove"
                :before-remove="beforeRemove"
                multiple
                :limit="1"
                :on-exceed="handleExceed"
                :file-list="fileList"
                style="    padding-left: 200px;">
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">只能上传一个数据集文件</div>
            </el-upload>

            <div style="padding-top: 50px;padding-left: 50px;">
              <p style="font-weight:bold;margin-bottom: -20px; ">
                算法选择：
              </p>
              <el-select v-model="value"
                         style="padding-left: 100px;"
                         placeholder="请选择">
                <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                </el-option>
              </el-select>
            </div>
            <div style="padding-left: 200px; padding-top: 50px;">
              <el-button type="primary">开始预测</el-button>
            </div>


          </div>
        </el-col>
      </el-row>

    </el-container>
  </div>
</template>

<script>
export default {
  name: "Predict",
  data() {
    return {
      // fileList: [{name: 'food.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}, {name: 'food2.jpeg', url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'}]
      options: [{
        value: '选项1',
        label: '算法1'
      }, {
        value: '选项2',
        label: '算法2'
      }],value: ''
    };
  },
  methods: {
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      this.$message.warning(`当前限制选择 1 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    }
  }
}
</script>

<style>
.el-menu-item i {
  color: #121416;
}
</style>


